﻿@model Domain.Model.Publish

@section Script
{
    <link href="~/Content/validBox/validBox.css" rel="stylesheet" />
    <script src="~/Content/validBox/validBox.js"></script>
    <link href="~/Content/window/window.css" rel="stylesheet" />
    <script src="~/Content/window/window.js"></script>
    <script type="text/javascript">
        function saveForm() {
            $('form').validBox(function (r) {
                if (r == false) return;
                $.post("/trade/create", $('form').serialize(), function (data) {
                    if (data.state) {
                        location.href = "/trade/index";
                    } else {
                        window.messageBox('提示', data.value);
                    }
                });
            });
        }
    </script>
}
<div>
    <ul class="breadcrumb">
        <li><a href="/user/activate">用户管理</a> <span class="divider">/</span></li>
        <li class="active">用户编辑</li>
    </ul>
</div>

<form class="form-horizontal" method="POST">


    <div class="control-group">
        <label class="control-label" for="Name">期数</label>
        <div class="controls">
            @Html.TextBoxReadonlyFor(i=>i.No)
        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="Name">发布数量</label>
        <div class="controls">
            @Html.TextBoxFor(item => item.Quantity, Html.ValidFor(item => item.Quantity))
        </div>
    </div>

        <div class="control-group">
        <label class="control-label" for="Name">单价</label>
        <div class="controls">
            @Html.TextBoxFor(item => item.UnitPrice, Html.ValidFor(item => item.UnitPrice))
        </div>
    </div>

     

    <div class="control-group">
        <label class="control-label"></label>
        <div class="controls">
            <input type="button" onclick="saveForm(); return false;" class="btn btn-info" value="保存" />
            <input type="button" class="btn btn-info" value="取消" onclick="history.go(-1); return false;" />
        </div>
    </div>


    @Html.HiddenFor(item => item.ID)
</form>
